/*
    XTU OJ: 1263
    by: fifth_light
*/

#include <stdio.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

typedef struct {
    int top;
    int left;
    int right;
    int bottom;
} rect;

int read_rect(rect* res) {
    int x1, y1, x2, y2;
    if (scanf("%d%d%d%d", &x1, &y1, &x2, &y2) == EOF) {
        return EOF;
    }
    res -> top = MIN(y1, y2);
    res -> left = MIN(x1, x2);
    res -> right = MAX(x1, x2);
    res -> bottom = MAX(y1, y2);
    return 0;
}

void sort(int arr[4]) {
    for (int i = 0; i < 4; i++) {
        for (int j = 0; j < 3; j++) {
            if (arr[j] < arr[j + 1]) {
                int tmp = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = tmp;
            }
        }
    }
}

int calc(rect a, rect b) {
    // a相对b

    // 0: 在里面
    // 1: 在左边
    // 2: 在右边
    int x = 0;
    // 0: 在里面
    // 1: 在上边
    // 2: 在下边
    int y = 0;
    if (b.left > a.right) {
        x = 1;
    } else if (b.right < a.left) {
        x = 2;
    }
    if (b.top > a.bottom) {
        x = 1;
    } else if (b.bottom < a.top) {
        x = 2;
    }
    int s = 0;
    if (x == 0 && y == 0) {
        int xarr[4] = {a.left, a.right, b.left, b.right};
        int yarr[4] = {a.top, a.bottom, b.top, b.bottom};
        sort(xarr);
        sort(yarr);
        s = (xarr[1] - xarr[2]) * (yarr[1] - yarr[2]);
    }
    int sa, sb;
    sa = (a.right - a.left) * (a.bottom - a.top);
    sb = (b.right - b.left) * (b.bottom - b.top);
    return sa + sb - s;
}

int main(void) {
    while(1) {
        rect a, b;
        if (read_rect(&a) == EOF) {
            break;
        }
        if (read_rect(&b) == EOF) {
            break;
        }
        printf("%d\n", calc(a, b));
    }
    return 0;
}
